

var ElementUtils={
    messageBox:function (info,url,width,height) {
        if(width==null){
            width=600;
        }
        if(height==null){
            height=600;
        }
        var content = '<iframe src="' + url + '" width='+width+'px" height="'+height+'px" frameborder="0" ></iframe>';
        window.parent.vm.$alert(content, info, {
            dangerouslyUseHTMLString: true
        });
    },

    dialog:function ( vm , info , url  ,params ,width , height) {
        if(url.indexOf("?") != -1 ){
            url+="&_t="+new Date().getTime();
        }else{
            url+="?_t="+new Date().getTime();
        }
        top.vm.dialogInfo.title=info;
        top.vm.dialogInfo.url=url;
        top.vm.dialogInfo.dialogVisible=true;
        top.vm.dialogInfo.vm=vm;
        if(params==null){
            params={};
        }
        top.vm.dialogInfo.params=params;
    },
    delete:function ( vm , url , params) {
        top.vm.$confirm('确定删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'info '
        }).then(() => {
            var res=ajaxPost(url,params);
            if(res == true){
                top.vm.$message({type: 'success', message: '删除成功!'});
                vm.refresh();
            }else{
                top.vm.$message({type: 'success', message: '删除失败!'});
            }
        }).catch(() => {});
    }
};
